package com.leve.admin.controller;

import io.swagger.annotations.*;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import static org.springframework.http.MediaType.APPLICATION_JSON_UTF8_VALUE;

@Api(value = "用户API", tags = "用户")
@RestController
@RequestMapping("users")
@RequiredArgsConstructor
public class UserController {

    @ApiOperation("获取用户")
    @ApiResponses({@ApiResponse(code = 404, message = "用户不存在")})
    @GetMapping(value = "{user_id}", produces = APPLICATION_JSON_UTF8_VALUE)
    public String getUser(@ApiParam(value = "用户标识", required = true)
                          @PathVariable("user_id") String userId,
                          @ApiParam(value = "查询者的用户标识")
                          @RequestParam(value = "viewer_id", required = false) String viewerId) {
        return "{\"id\":\"5c25980c336f3d60c4347cf3\",\"username\":\"administrator\",\"username_custom\":false,\"country_code\":86,\"phone\":18087654321,\"password_existed\":false,\"nickname\":\"嘿嘿嘿\",\"im_id\":\"5c25980c336f3d60c4347cf3\",\"token\":\"dd38abd1e4f9c97bcda5b492b1a0a7b6\",\"avatar\":\"http://leve-im-image.oss-cn-shenzhen.aliyuncs.com/a5d9c41c52cb436e985c0aaa0cc50f70.gif\",\"small_avatar\":\"http://leve-im-image.oss-cn-shenzhen.aliyuncs.com/418a1c03b3e64c789762f1fe472ec16c.jpg\",\"face_id\":\"1326780fc115cc554bb1063cde317b2d\",\"privacy\":{\"story_access\":\"ALL\",\"message_access\":\"ALL\"},\"default_ghost_id\":\"5c259846336f3d6427274f16\",\"friend\":false,\"total_followers\":1,\"total_followings\":1,\"total_greetings\":0}";
    }

}
